package com.pb.web.action;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.opensymphony.xwork2.ActionSupport;
import com.pb.entity.Street;

public class OGNLAction extends ActionSupport {

	private static final long serialVersionUID = 4654540072713895872L;

	private List<Street> streetsList;
	private Map<String, Street> streetsMap;
	private Set<Street> streetsSet;

	/**
	 * 获取 streetsList
	 * 
	 * @return streetsList
	 */
	public List<Street> getStreetsList() {
		return streetsList;
	}

	/**
	 * 设置 streetsList
	 * 
	 * @param streetsList
	 *            streetsList
	 */
	public void setStreetsList(List<Street> streetsList) {
		this.streetsList = streetsList;
	}

	/**
	 * 获取 streetsMap
	 * 
	 * @return streetsMap
	 */
	public Map<String, Street> getStreetsMap() {
		return streetsMap;
	}

	/**
	 * 设置 streetsMap
	 * 
	 * @param streetsMap
	 *            streetsMap
	 */
	public void setStreetsMap(Map<String, Street> streetsMap) {
		this.streetsMap = streetsMap;
	}

	/**
	 * 获取 streetsSet
	 * 
	 * @return streetsSet
	 */
	public Set<Street> getStreetsSet() {
		return streetsSet;
	}

	/**
	 * 设置 streetsSet
	 * 
	 * @param streetsSet
	 *            streetsSet
	 */
	public void setStreetsSet(Set<Street> streetsSet) {
		this.streetsSet = streetsSet;
	}

	@Override
	public String execute() throws Exception {
		streetsList = new ArrayList<Street>();
		streetsList.add(new Street(1, "一街"));
		streetsList.add(new Street(2, "二街"));
		streetsList.add(new Street(3, "三街"));

		streetsMap = new HashMap<String, Street>();
		streetsMap.put("n1", new Street(4, "四街"));
		streetsMap.put("n2", new Street(5, "五街"));

		streetsSet = new HashSet<Street>();
		streetsSet.add(new Street(6, "六街"));
		streetsSet.add(new Street(7, "七街"));
		return SUCCESS;
	}
}
